home *** CD-ROM | disk | FTP | other *** search
- /*
- * TSyntaxMemoParser Script
- * ------------------------
- *
- * Author : David Brock
- * Date : October 21 1997
- * Language: e-mail
- *
- * ------------------------------------
- *
- * Revisions
- * 02-11-97 Added et_PREVIOUS style to allow highlighting of
- * previous, previous... messages differently. Altered
- * et_ORIGINAL to reside in %%words section. Now
- * clearly starts at beginning of line as per text.
- */
-
-
- //--------------------------------------------------------------------------------------------------------------------
- //
- //
- //
- // Macro definitions. Parameters may be specified and the replacement text terminates with the end of
- // line (watch trailing blanks).
- //
- #define pt_DEFAULT 0
- #define et_WEB 1
- #define et_MAIL 2
- #define et_ORIGINAL 3
- #define et_PREVIOUS 4
-
- #define _all_chars_ '[\x00-\xFF]'
- #define _dont_care_ _all_chars_
- #define _DEFAULT_BACKGROUND clWhite
- #define _DEFAULT_FOREGROUND clBlack
-
- #define _NO_GUTTER 0
-
- #define ss_START 0
- #define ss_ORIGINAL 1
-
- //--------------------------------------------------------------------------------------------------------------------
- //
- // %%language section
- //
- // Header section. Describes the textual name of the language, case sensitivity and options used by the language.
- //
- %%language
- Name = 'e-mail'
- Case = __INSENSITIVE
- Options = __DEFAULT_OPTIONS + 1024 + 8192 // Turn on word wrap & word-wrap override
- WordWrapColumn = 0
- Gutter = _NO_GUTTER
- Anchor = _DEFAULT_START_ANCHOR
- WrapOverride = '>:|'
- ExampleText = 'From: David Brock <dbrock@cqm.co.uk>\n\
- \To : All\n\
- \Re : TSyntaxMemo\n\
- \------------------------------------\n\
- \>Can I have more Info please.\n\
- \Download from http://users.colloquium.com.uk/~dbrock/syned.zip\n'
-
- EditableStyles ('Original message', et_ORIGINAL),
- ('Previous messages',et_PREVIOUS),
- ('Mail address', et_MAIL),
- ('Web address', et_WEB),
- ('Default', pt_DEFAULT)
-
-
-
-
- //--------------------------------------------------------------------------------------------------------------------
- //
- // %%words section
- //
- //
- %%words
- 'http://' _dont_care_ et_WEB [ss_START ss_ORIGINAL]
- 'www.' _dont_care_ et_WEB [ss_START ss_ORIGINAL]
- 'ftp://' _dont_care_ et_WEB [ss_START ss_ORIGINAL]
- 'ftp.' _dont_care_ et_WEB [ss_START ss_ORIGINAL]
- ':' _dont_care_ et_ORIGINAL
- '>' _dont_care_ et_ORIGINAL
- '|' _dont_care_ et_ORIGINAL
- '>>' _dont_care_ et_PREVIOUS
- '>:' _dont_care_ et_PREVIOUS
- '>|' _dont_care_ et_PREVIOUS
- '::' _dont_care_ et_PREVIOUS
- ':|' _dont_care_ et_PREVIOUS
- ':>' _dont_care_ et_PREVIOUS
- '||' _dont_care_ et_PREVIOUS
- '|:' _dont_care_ et_PREVIOUS
- '|>' _dont_care_ et_PREVIOUS
- '\n:' _dont_care_ et_ORIGINAL
- '\n>' _dont_care_ et_ORIGINAL
- '\n|' _dont_care_ et_ORIGINAL
- '\n>>' _dont_care_ et_PREVIOUS
- '\n>:' _dont_care_ et_PREVIOUS
- '\n>|' _dont_care_ et_PREVIOUS
- '\n::' _dont_care_ et_PREVIOUS
- '\n:|' _dont_care_ et_PREVIOUS
- '\n:>' _dont_care_ et_PREVIOUS
- '\n||' _dont_care_ et_PREVIOUS
- '\n|:' _dont_care_ et_PREVIOUS
- '\n|>' _dont_care_ et_PREVIOUS
-
- //--------------------------------------------------------------------------------------------------------------------
- //
- // %%handler section
- //
- // For e-mail we must recognise WEB URLs that have started with 'http://' or whatever is present in the %%words
- // section for et_WEB. The entire matching process is dealt with in the _WEB_CHAR predefined character function.
- // _WEB_CHAR actually matches an entire URL tail and returns true/false for success/failure. Hence we can specify
- // that _all_chars_ may follow and be discarded.
- //
- //
- %%handler
- et_WEB _WEB_CHAR _all_chars_ _discard_
- et_ORIGINAL _ORIGINAL_CHAR _all_chars_ _discard_
- et_PREVIOUS _ORIGINAL_CHAR _all_chars_ _discard_
-
- //--------------------------------------------------------------------------------------------------------------------
- //
- // %%tokens section
- //
- // E-Mail addresses are handled by a pre-defined token function that only recognises items when an '@' is present.
- //
- // Original text lines must be dealt with here, the pre-defined function _ORIGINAL_CHAR correctly identifies
- // lines that are suitable for original text and gobbles all characters on the line.
- //
- %%tokens
- et_MAIL __STD_MAIL_URL [ss_START ss_ORIGINAL]
-
- //--------------------------------------------------------------------------------------------------------------------
- //
- // %%effects section
- //
- // Specifying et_MAIL and et_WEB as 'hotspot' will cause the cursor change and hover/click events to be generated
- // for these lexemes.
- //
- %%effects
- pt_DEFAULT [] _DEFAULT_FOREGROUND _DEFAULT_BACKGROUND
- et_MAIL [] clBlue _DEFAULT_BACKGROUND 'hotspot'
- et_WEB [] clRed _DEFAULT_BACKGROUND 'hotspot'
- et_ORIGINAL [] clGreen _DEFAULT_BACKGROUND
- et_PREVIOUS [] clSilver _DEFAULT_BACKGROUND
-
-
- //--------------------------------------------------------------------------------------------------------------------
- //
- // %%map section
- //
- // Normally the %%map table consists of identical value entries.
- //
- %%map
- et_MAIL et_MAIL
- et_WEB et_WEB
- et_ORIGINAL et_ORIGINAL
- et_PREVIOUS et_PREVIOUS
-
- %%containers
- et_ORIGINAL (+[ss_ORIGINAL] -[ss_START])
- et_PREVIOUS (+[ss_ORIGINAL] -[ss_START])
-
-
-